#include<bits/stdc++.h>
using namespace std;
using ll = long long int;
ll a, h, b, k, ret;


int main()
{
    cin >> a >> h >> b >> k;
    while (h>0 && k>0)
    {
        ret += a + b;
        h -= b;
        k -= a;
    }
    if (h>0)
    {
        ret += a * 10;
    }
    if (k>0)
    {
        ret += b * 10;
    }
    cout << ret << endl;
    return 0;
}

